/*
 * @Description:
 * @Author: Zzt
 * @Date: 2023-03-01 17:29:48
 * @LastEditTime: 2023-03-01 18:29:15
 */
import request from '@/utils/request';
import { Key } from 'react';
import { IPageQuery } from '@/interfaces/global';
export interface IFavouriteParams {
  archiveTypeId?: number;
  dbName?: string;
  entryId?: number;
  fondsId?: number;
  level?: number;
  remark?: string;
  title?: string;
}
// 分页获取收藏夹列表
export function fetchFavouriteByPage(data: IPageQuery<IFavouriteParams>) {
  return request({
    url: `/archive-favorite/page`,
    method: 'post',
    data
  });
}
// 新增收藏夹列表
export function addFavouriteList(data: IFavouriteParams) {
  return request({
    url: `/archive-favorite`,
    method: 'post',
    data
  });
}
// 修改收藏夹列表
export function editFavouriteList(data: IFavouriteParams) {
  return request({
    url: `/archive-favorite`,
    method: 'put',
    data
  });
}
// 查询列表
export function fetchFavouriteList(data: IFavouriteParams) {
  return request({
    url: `/archive-favorite/list`,
    method: 'post',
    data
  });
}
// 根据ID查询收藏夹
export function fetchFavouriteById(id: number) {
  return request({
    url: `/archive-favorite/${id}`,
    method: 'get'
  });
}
// 根据ID删除收藏夹
export function delFavouriteById(id: string | number) {
  return request({
    url: `/archive-favorite/${id}`,
    method: 'delete'
  });
}
